How do I use if statement to return -1 if what I am searching for is not in my array